:root {
  --bad-example-text: gray;

  --control-glyph-text: #d50606;

  --img-abstract-bg: #424242;
  --img-abstract-text: #ffffff;
}

@media (prefers-color-scheme:  dark) {
  :root {
    --bad-example-text: gray;

    --control-glyph-text: #d50606;

    --img-abstract-bg: #424242;
    --img-abstract-text: #ffffff;
  }
}

iframe { border: 0; }

.bad, .bad *:not(.X\58X) { color: var(--bad-example-text); }

.applies thead th > * { display: block; }
.applies thead code { display: block; }
.applies td { text-align: center; }

.matrix, .matrix td { border: hidden; text-align: right; }
.matrix, .equations { margin-left: 2em; }

.vertical-summary-table tr > th[rowspan="2"]:first-child + th,
.vertical-summary-table tr > td[rowspan="2"]:first-child + td { border-bottom: hidden; }

.dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
.dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
.dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }

td.eg { border-width: thin; text-align: center; }

#table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
#table-example-1 caption { padding-bottom: 0.5em; }
#table-example-1 thead, #table-example-1 tbody { border: none; }
#table-example-1 th, #table-example-1 td { border: solid thin; }
#table-example-1 th { font-weight: normal; }
#table-example-1 td { border-style: none solid; vertical-align: top; }
#table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
#table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
#table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
#table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
#table-example-1 tbody td:first-child::after { content: leader(". "); }
#table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
#table-example-1 tbody td:first-child + td { width: 10em; }
#table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
#table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }

#table-import-map-scopes-example th[row="3"] { writing-mode: vertical-rl; }

#table-fa { border-top: solid; }
#table-fa .example {
  margin: 2em 0 1.5em 0;
  padding: 1em 1em;
}
#table-fa .example::before { display: block; }

.apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
.apple-table-examples * { font-family: "Times", serif; }
.apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
.apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
.apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
.apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
.apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
.apple-table-examples td { text-align: right; vertical-align: top; }
.apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
.apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
.apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
.apple-table-examples sup { line-height: 0; }

.three-column-nowrap tr > td:first-child,
.three-column-nowrap tr > td:first-child + td,
.three-column-nowrap tr > td:first-child + td + td { white-space: nowrap; }

.details-example img { vertical-align: top; }

.parse-error-table td > p:first-child { margin-top: 0; }

#named-character-references-table {
  white-space: nowrap;
  font-size: 0.6em;
  column-width: 30em;
  column-gap: 1em;
}
#named-character-references-table > table > tbody > tr > td:first-child + td,
#named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
#named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.2em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: var(--bg, Canvas); width: 1.25em; height: auto; text-align: center; }
#named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
#named-character-references-table span.glyph.control { color: var(--control-glyph-text); }

#table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
@font-face {
  font-family: 'Essays1743';
  src: url('/fonts/Essays1743.ttf');
}
@font-face {
  font-family: 'Essays1743';
  font-weight: bold;
  src: url('/fonts/Essays1743-Bold.ttf');
}
@font-face {
  font-family: 'Essays1743';
  font-style: italic;
  src: url('/fonts/Essays1743-Italic.ttf');
}
@font-face {
  font-family: 'Essays1743';
  font-style: italic;
  font-weight: bold;
  src: url('/fonts/Essays1743-BoldItalic.ttf');
}

@media (max-width: 767px) {
  #abstractimg { width: 100%; }
}
#abstractimg, #abstractimg text { font: inherit; }
#abstractimg rect { fill: var(--img-abstract-bg); }
#abstractimg text { fill: var(--img-abstract-text); }
#abstractimg .horizontal, #abstractimg .left { word-spacing: 12px; font-size: 18px; text-anchor: middle; }
#abstractimg .right { font-size: 25px; }

#module-script-fetching-diagram {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 1024px;
}

#module-script-fetching-diagram rect {
  stroke: var(--text, CanvasText);
  fill: transparent;
}

#module-script-fetching-diagram path {
  stroke: var(--text, CanvasText);
}
#module-script-fetching-diagram path[marker-end] {
  fill: transparent;
}

#module-script-fetching-diagram a {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jake-diagram {
  border-style: hidden none hidden hidden;
  table-layout: fixed;
}

.jake-diagram, .jake-diagram :is(td, th, tr) {
  border-color: var(--text);
}

.jake-diagram :where(th.step) {
  width: 95px;
  font-weight: normal;
}

.jake-diagram th:not(.step) {
  text-align: right;
}

.jake-diagram td.next-is-same-doc {
  border-right: dotted 2px;
}

.jake-diagram td.prev-is-same-doc {
  border-left: dotted 2px;
}

.jake-diagram .current {
  font-style: italic;
  font-weight: bold;
}

/* Chosen by clicking around https://colorhunt.co/palettes/pastel */
.jake-diagram .doc-0 { background: #F0EBE3; }
.jake-diagram .doc-1 { background: #EEE4AB; }
.jake-diagram .doc-2 { background: #D3CEDF; }
.jake-diagram .doc-3 { background: #D6EFED; }
.jake-diagram .doc-4 { background: #F4BFBF; }
.jake-diagram .doc-5 { background: #DAE5D0; }

@media (prefers-color-scheme: dark) {
  .jake-diagram .doc-0 { background: #030637; }
  .jake-diagram .doc-1 { background: #3C0753; }
  .jake-diagram .doc-2 { background: #720455; }
  .jake-diagram .doc-3 { background: #910A67; }
  .jake-diagram .doc-4 { background: #872341; }
  .jake-diagram .doc-5 { background: #B33030; }
}

/* Dfn panels */
.dfn-panel {
  display: inline-block;
  position: absolute;
  z-index: 35;
  height: auto;
  width: -webkit-fit-content;
  width: fit-content;
  max-width: 300px;
  max-height: 500px;
  overflow: auto;
  padding: 0.5em 0.75em;
  font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
  background: var(--dfnpanel-bg);
  color: var(--dfnpanel-text);
  border: outset 0.2em;
  cursor: initial;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: var(--dfnpanel-text); }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel p:not(.spec-link) { font-weight: bolder; }
.dfn-panel > b + b,
.dfn-panel > * + p { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: none; }
.dfn-panel.activated {
  position: fixed;
  left: .5em;
  bottom: 2em;
  margin: 0 auto;
  max-width: calc(100vw - 1.5em - .4em - .5em);
  max-height: 30vh;
}

/* Elements that trigger a dfn panel when clicked. */
body.dfnEnabled dfn,
body.dfnEnabled h2[data-dfn-type],
body.dfnEnabled h3[data-dfn-type],
body.dfnEnabled h4[data-dfn-type],
body.dfnEnabled h5[data-dfn-type],
body.dfnEnabled h6[data-dfn-type] {
  cursor: pointer;
}
